<?php

/**
 * 安心站长axzz.cn，一个追求技术创造者。让网站、小程序、APP、应用程序牛起来……
 *
 * cighsen02 365182575
 * 
 * Create at: 2022.06.20
 * Update at: 2025.08.31
 */

namespace Twoir\System\Model;

use Twoir\System\Support\BothTrait;
use Twoir\System\Support\ParseTrait;

/**
 * 前台会员模型 帝国8.0版本专用
 *
 * 【注意事项】有增减字段，请更新 字段：FIELD自定义区和默认值：MYDEFAULT自定义区，没有更新请勿动！！！
 */
class EnewsMember
{
    use BothTrait, ParseTrait;

    const TABLE = [
        'pri' 	=> 'enewsmember',
        'sec' 	=> 'enewsmemberadd',//副表
    ];

    // 主键
    const PRIMARY = 'userid';

    const FIELD = [
        'pri' => [
            //系统字段
            'userid',
            'username',
            'password',
            'rnd',
            'email',
            'registertime',
            'groupid',
            'userfen',
            'userdate',
            'money',
            'zgroupid',
            'havemsg',
            'checked',
            'salt',
            'userkey',
            'ingid',
            'agid',
            'isern',
            'isot',
            'phno',
            'upic',
            'mustdo',
            'rndt',
            'userjyz',
            'usertitle'

            // 自定义字段

        ],
        'sec' => [
            // 系统字段
            'userid',
            'spacestyleid',
            'spacename',
            'spacegg',
            'viewstats',
            'regip',
            'lasttime',
            'lastip',
            'loginnum',
            'regipport',
            'lastipport',
            'eipf',

            // 自定义字段(帝国预安装内置的字段)
            'company',
            'truename',
            'mycall',
            'fax',
            'phone',
            'oicq',
            'msn',
            'homepage',
            'address',
            'zip',
            'saytext'
        ],
    ];

    /**
     * 默认值
     */
    const MYDEFAULT = [
        // 主表
        'pri' => [
            // 系统字段
            'userid'		=> null,
            'username'		=> '',
            'password'		=> '',
            'rnd'			=> '',
            'email'			=> '',
            'registertime'	=> 0,
            'groupid'		=> 0,
            'userfen'		=> 0,
            'userdate'		=> 0,
            'money'			=> 0,
            'zgroupid'		=> 0,
            'havemsg'		=> 0,
            'checked'		=> 0,
            'salt'			=> '',
            'userkey'		=> '',
            'ingid'			=> 0,
            'agid'			=> 0,
            'isern'			=> 0,
            'isot'          => 0,
            'phno'          => '',
            'upic'          => 0,
            'mustdo'        => 0,
            'rndt'          => '',
            'userjyz'       => 0,
            'usertitle'     => ''

            // 自定义字段

        ],

        // 副表
        'sec' => [
            // 系统字段
            'userid'		=> null,
            'spacestyleid'	=> 0,
            'spacename'		=> '',
            'spacegg'		=> '',
            'viewstats'		=> 0,
            'regip'			=> '',
            'lasttime'		=> 0,
            'lastip'		=> '',
            'loginnum'		=> 0,
            'regipport'		=> '',
            'lastipport'	=> '',
            'eipf'          => '',

            // 自定义字段(帝国预安装内置的字段)
            'company'		=> '',
            'truename'		=> '',
            'mycall'		=> '',
            'fax'			=> '',
            'phone'			=> '',
            'oicq'			=> '',
            'msn'			=> '',
            'homepage'		=> '',
            'address'		=> '',
            'zip'			=> '',
            'saytext'		=> ''
        ]
    ];

    // 执行mysql置后
    protected static $low_priority = false;
}
